<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>新闻类别发布</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<script type="text/javascript" src="${webRootPath }/maintain/js/newsClass.js"></script>
		<script type="text/javascript" src="${webRootPath }/common/js/maintain.js"></script>
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	</head>

	<body>
		<!-- 新闻类别发布 -->
		<br>
		<div id="buildUpNewsClass" align="center">
		<font color="red"><c:out value="${addMessage}"></c:out></font>
			<form action="maintain_NewsClassAction_addNewsClass_post.do"
				method="post">
				<table width="80%" align="center" border="1  solid red"
					align="center" cellpadding="1" cellspacing="0">
					<tr bgcolor="#95CACA">
						<td align="center" colspan="2" height="25">
							<strong>添加新闻类别</strong>
						</td>
					</tr>
					<tr >
						<td align="center">
							新闻类名：
						</td>
						<td>
							<input type="text" name="newsClassName">
						</td>
					</tr>
					<tr>
					<td align=center colspan="2" height="25">
					     <input type="submit" name="添加" value="添加">
						 <input type="reset" name="取消" value="取消">
					</td>
					</tr>
				</table>
			</form>
		</div>

		<!-- 新闻类别管理 -->
		<br>
		<br>
		<div id="operateMessage" align="center"></div>
		<table width="80%" align="center" border="1  solid red"
			align="center" cellpadding="2" cellspacing="0">
			<tr bgcolor="#95CACA">
				<td align="center" height="25"  colspan="3" >
					<strong>管理新闻类别</strong>
				</td>
			</tr>
			<tr  bgcolor="#95CACA">
				<td width="10%" align="center">
					id
				</td>
				<td width="40%" align="center">
					新闻类名
				</td>
				<td width="30%" align="center">
					操作
				</td>
			</tr>
			<c:forEach items="${allNewsClass}" var="newsClass">
				<tr id="${newsClass.newClassId}">
					<td align="center">
						${newsClass.newClassId}
					</td>
					<td align="center" id="${newsClass.newClassId+1000000}"
						onclick="update(${newsClass.newClassId+1000000})">
						${newsClass.newClassName}
					</td>
					<td align="center">
						<a href="javascript:Delete(${newsClass.newClassId},${newsClass.newClassId})">删除</a>
					</td>
				</tr>
			</c:forEach>
		</table>

	</body>
</html>
